from wechatpy.session import SessionStorage
from wechatpy import WeChatClient

from .models import AccessToken

# python的微信第三方类库wechatpy 临时token存储
class CustomStorage(SessionStorage):

    def __init__(self, *args, **kwargs):
        pass

    def get(self, key, default=None):
        return AccessToken().get_valid_token()

    def set(self, key, value, ttl=None):
        pass

    def delete(self, key):
        pass